<template>
  <div class="box">
    <div class="top">
      <p class="title">实时游客统计</p>
      <p class="bg"></p>
      <p class="right">
        可预约总量
        <span>99999</span>
        人
      </p>
    </div>
    <div class="number">
      <span v-for="(item, index) in people" :key="index">{{ item }}</span>
    </div>
    <!-- 盒子将来echarts展示图形图标的节点 -->
    <div class="charts" ref="charts"></div>
  </div>
</template>

<script setup lang="ts">
import { ref, onMounted } from 'vue'
let people = ref('215908人')
import * as echarts from 'echarts'
//水球图拓展插件
import 'echarts-liquidfill'
//获取节点
let charts = ref()
onMounted(() => {
  //获取echarts类的实例
  let mycharts = echarts.init(charts.value)
  //设置实例的配置项
  mycharts.setOption({
    //标题组件
    title: {
      text: '',
    },
    // xAxis: {}, //x,y轴
    // yAxis: {},
    //系列：决定你展示什么样的图形图标
    series: {
      type: 'liquidFill', //系列
      data: [0.6, 0.4, 0.2], //波浪条数
      animationDuration: 3,
      animationDurationUpdate: 0,
      radius: '90%', //半径
    },
    //布局组件
    grid: {
      left: 0,
      right: 0,
      top: 0,
      bottom: 0,
    },
  })
})
</script>

<style scoped lang="scss">
.box {
  background: url(../../images/dataScreen-main-lt.png) no-repeat center/cover;
  margin-top: 15px;
  .top {
    margin-left: 20px;
    .title {
      color: #fff;
      font-size: 20px;
    }
    .bg {
      width: 68px;
      height: 7px;
      background: url(../../images/dataScreen-title.png) no-repeat center/cover;
      margin-top: 10px;
    }
    .right {
      float: right;
      color: #fff;
      font-size: 16px;
      span {
        color: yellowgreen;
      }
    }
  }
  .number {
    display: flex;
    margin-top: 30px;
    padding: 0 20px;
    width: 100%;
    box-sizing: border-box;
    span {
      flex: 1;
      margin-left: 2px;
      height: 60px;
      text-align: center;
      line-height: 60px;
      background: url(../../images/total.png) no-repeat center/cover;
      color: #29fcff;
      font-size: 30px;
      font-weight: 700;
    }
  }
  .charts {
    width: 100%;
    height: 280px;
    margin-top: 20px;
  }
}
</style>
